/**
 * Created by win7 on 2017/3/15.
 */
import Relay from "react-relay";

export default class GetEnterpriseListMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getEnterpriseList }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageNum: this.props.pageNum,
                pageSize: this.props.pageSize,
                enterpriseName:this.props.enterpriseName
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getEnterpriseListPayload {
            data {
                errorCode
                value
                totalResult
                id
                token
                enterpriseList{
                    telephone
                    userName
                    enterpriseId
                    enterpriseName
                    serviceTypeName
                    employeeNum
                    status
                    userPhone
                    createTime
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on getEnterpriseListPayload {
            data {
                errorCode
                value
                totalResult
                id
                token
                    enterpriseList{
                        telephone
                        userName
                        enterpriseId
                        enterpriseName
                        serviceTypeName
                        employeeNum
                        status
                        userPhone
                        createTime
                    }
                }
                }
            `]
        }];
    }

}